<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <title>test</title>

</head>

<body>


  <div class="app-expense-table app-expense-table--bordered app-expense-table--scrollable">
    <div class="app-expense-table__header" style="margin-right: 15px;">
      <table class="app-expense-table__box">
        <colgroup>
          <col style="width: auto;">
          <col style="width: 50%;">
          <col style="width: auto;">
          <col style="width: auto;">
        </colgroup>
        <thead>
          <tr>
            <th class="">
              <div><span class="app-expense-text-overflow" title="组件">组件</span></div>
            </th>
            <th class="">
              <div><span class="app-expense-text-overflow" title="用量*时长">用量*时长</span></div>
            </th>
            <th class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="总费用(元)">总费用(元)</span></div>
            </th>
            <th class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="占比">占比</span></div>
            </th>
          </tr>
        </thead>
      </table>
    </div>
    <div class="app-expense-table__body" style="max-height: 181px;">
      <table class="app-expense-table__box">
        <colgroup>
          <col style="width: auto;">
          <col style="width: 50%;">
          <col style="width: auto;">
          <col style="width: auto;">
        </colgroup>
        <tbody>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云原生数据库MySQL-CCU">云原生数据库MySQL-CCU</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="549.05400000 个 * 小时">549.05400000 个 * 小时</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="187.78">187.78</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="42.01%">42.01%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云托管-内存-微信">云托管-内存-微信</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="4096.88555554 GiB*小时 * 小时">4096.88555554 GiB*小时 *
                  小时</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="131.10">131.10</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="29.33%">29.33%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云托管-CPU-微信">云托管-CPU-微信</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="2048.44277777 核时 * 小时">2048.44277777 核时 * 小时</span>
              </div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="112.66">112.66</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="25.20%">25.20%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云原生数据库MySQL-存储">云原生数据库MySQL-存储</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="2067.05078127 GB * 小时">2067.05078127 GB * 小时</span>
              </div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="10.03">10.03</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="2.24%">2.24%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云托管-流量">云托管-流量</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="3.18251067 GB * 小时">3.18251067 GB * 小时</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="2.55">2.55</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.57%">0.57%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云托管-对象存储-容量">云托管-对象存储-容量</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="567.93554693 GB * 天">567.93554693 GB * 天</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="2.44">2.44</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.55%">0.55%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云开发-CDN-CDN流量">云开发-CDN-CDN流量</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="1.26248868 GB * 天">1.26248868 GB * 天</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.27">0.27</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.06%">0.06%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云托管-对象存储-CDN回源流量">云托管-对象存储-CDN回源流量</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="0.80122188 GB * 天">0.80122188 GB * 天</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.12">0.12</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.03%">0.03%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云托管-对象存储-下载操作次数">云托管-对象存储-下载操作次数</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="5.69870000 万次调用 * 天">5.69870000 万次调用 * 天</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.06">0.06</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.01%">0.01%</span></div>
            </td>
          </tr>
          <tr>
            <td class="">
              <div><span class="app-expense-text-overflow" title="云托管-对象存储-上传操作次数">云托管-对象存储-上传操作次数</span></div>
            </td>
            <td class="">
              <div><span class="app-expense-text-overflow" title="0.60830000 万次调用 * 天">0.60830000 万次调用 * 天</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.01">0.01</span></div>
            </td>
            <td class="app-expense-text-right">
              <div><span class="app-expense-text-overflow" title="0.00%">0.00%</span></div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>

</body>
<script>
  function copyText(text) {
    const textarea = document.createElement('textarea');
    textarea.value = text;
    document.body.appendChild(textarea);
    textarea.select();
    document.execCommand('copy');
    document.body.removeChild(textarea);
  }
  function getMicroAppElement() {
    const microApp = document.querySelector('micro-app[name="goods"]');
    if (microApp && microApp.shadowRoot) {
      const draggableContent = microApp.shadowRoot.querySelector('#props-editor > div.default_box.goods_details > div.box_content > div > form > div:nth-child(1) > div.weui-desktop-form__control-group > div > div.weui-desktop-new-upload__wrp > div');
      if (draggableContent) {
        console.log('成功选中目标元素：', draggableContent);
        return draggableContent;
      }
    }
  }
  const images = getMicroAppElement().querySelectorAll('img');
  // 提取所有图片的 src 属性
  const imageUrls = Array.from(images).map(img => img.src).filter(src => src); // 过滤空 src
  if (imageUrls.length > 0) {
    const images = imageUrls.filter(url => !url.includes('.svg')).map(e => e.split(/[?|#]/)[0]);
    console.log('找到的图片链接地址：', images);
    console.log('图片数量：', images.length);
    // 将图片链接复制到剪贴板
    copyText(images.join('\n'));
    console.log('已将图片链接复制到剪贴板');
  } else {
    console.log('draggable_content 内未找到图片');
  }
</script>

</html>